const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    entry: "./src/index.js",
    output: {
        path: __dirname + "/dist",
        filename: "main.js"
    },
    mode: "development",
    // 插件 ==>  使用任何一个插件 都需要new
    plugins: [
        new HtmlWebpackPlugin({template: './public/index.html'})
    ],
    devServer: {
        // 端口
        port: 3000,
        // 自动打开
        open: true
    }
}